package Book;

import User.Admir;
import User.Normal;
import User.User;

import java.util.Scanner;

public class Main {

    public static User login() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入您的姓名");
        String name = scanner.nextLine();
        System.out.println("请输入您的身份：1.普通用户 2.管理员");
        int choice = scanner.nextInt();
        if (choice == 1) {
            return new Normal(name);
        } else {
            return new Admir(name);
        }
    }
        public static void main(String[] args){
            BookList booklist = new BookList();

            User user = login();
            while (true) {
                int choice =user.menu();
             user.doIOPeration(choice,booklist);
            }
        }
    }


